package com.lazyfragmentdemo;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;


public class Viewpager_Adapter extends FragmentPagerAdapter {

    List<String> list_title;
    ArrayList<Fragment> list_fragment;

    public Viewpager_Adapter(FragmentManager fm, ArrayList<Fragment> list_fragment, List<String> list_title)
    {
        super(fm);
        this.list_title=list_title;
        this.list_fragment=list_fragment;
    }


    @Override
    public int getCount() {
        return list_fragment.size();
    }

    @Override
    public Fragment getItem(int position) {
        return  list_fragment.get(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list_title.get(position);
    }
}
